import request from '@/utils/request'

const knowManageApi = {
    /**
     * 知识库列表
     */
    lists(params: {
        page_no?: number;
        page_size?: number;
        name?: string;
        user?: string;
    }): Promise<any> {
        return request.get({
            url: '/agent/know/manage/lists',
            params
        })
    },

    /**
     * 知识库详情
     */
    detail(id: number): Promise<any> {
        return request.get({
            url: '/agent/know/manage/detail',
            params: { id }
        })
    },

    /**
     * 知识库删除
     */
    delete(id: number, reason?: string): Promise<any> {
        return request.post({
            url: '/agent/know/manage/delete',
            params: {
                id: id,
                reason: reason
            }
        })
    },

    /**
     * 知识库禁用
     */
    disable(id: number, reason?: string): Promise<any> {
        return request.post({
            url: '/agent/know/manage/disable',
            params: {
                id: id,
                reason: reason
            }
        })
    }
}

export default knowManageApi
